home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / misc / mirrorman_1_10b1.lha / MirrorManager-1.10b1 / rexx / Configure < prev    next >
Text File  |  1994-06-24  |  11KB  |  365 lines

  1. ;;
  2. ;; $VER: $Id: Configure,v 1.7 1994/06/18 13:11:29 tf Exp $
  3. ;;
  4. ;; Installer script configuring pathnames in MirrorManager.rexx
  5. ;; Initial revision by Tobias Ferber
  6. ;;
  7.  
  8.  
  9. ;@
  10. (set IncomingPath         "")
  11. (set AminetPath           "")
  12. (set KickedPath           "")
  13. (set FastIndexPath        "")
  14. (set AminetIndexFile      "")
  15. (set AminetRecentFile     "")
  16. (set AminetTreeFile       "")
  17. (set LocalIndexFile       "")
  18. (set WantedIndexFile      "")
  19. (set HiddenFile           "")
  20. (set IndexedFile          "")
  21. (set RemapFile            "")
  22.  
  23. ;@
  24.  
  25. (set ConfigureREXX      "Configure.rexx")
  26. (set AssignmentsFile    "RAM:AssignmentsTemp.tmp")
  27. (set ProgramIcon        (tackon (pathonly (expandpath @execute-dir)) "MirrorManager"))
  28. (set RX-command         (if (exists "SYS:rexxc/rx") ("SYS:rexxc/rx") ("rx")))  ;`which rx`
  29.  
  30. ;***
  31. (procedure configureMirrorManager
  32. ; configureScript
  33.  
  34.     (working ("Configuring %s" configureScript))
  35.  
  36.     ;;
  37.  
  38.     (complete 0)
  39.     (set IncomingPath (askdir
  40.         (prompt
  41.             "Please select your incoming path"
  42.         )
  43.         (help
  44.             "The incoming path should contain the files you download from Aminet.  "
  45.             "This is normally the receive path of your terminal program."
  46.             "\n\n"
  47.                         "For example:  \"incoming:\""
  48.                 )
  49.         (default IncomingPath)
  50.     ))
  51.  
  52.     ;;
  53.  
  54.     (complete 5)
  55.     (set AminetPath (askdir
  56.         (prompt
  57.             "Please select your Aminet path"
  58.         )
  59.         (help
  60.             "The Aminet path is the root directory of your local Aminet mirror.  "
  61.             "Files will be copied from the incoming path to this directory "
  62.             "or to a subdirectory relative to this directory."
  63.             "\n\n"
  64.             "For example:  \"downloads:aminet\""
  65.                 )
  66.         (default AminetPath)
  67.     ))
  68.  
  69.     (complete 10)
  70.  
  71.         ;; Eventually set initial defaults
  72.  
  73.     (if (= (strlen KickedPath)       0) (set KickedPath       (tackon AminetPath "kicked"))    )
  74.     (if (= (strlen FastIndexPath)    0) (set FastIndexPath    (tackon AminetPath "fastindex")) )
  75.     (if (= (strlen AminetIndexFile)  0) (set AminetIndexFile  (tackon AminetPath "INDEX"))     )
  76.     (if (= (strlen AminetRecentFile) 0) (set AminetRecentFile (tackon AminetPath "RECENT"))    )
  77.     (if (= (strlen AminetTreeFile)   0) (set AminetTreeFile   (tackon AminetPath "TREE"))      )
  78.     (if (= (strlen LocalIndexFile)   0) (set LocalIndexFile   (tackon AminetPath "LOCAL"))     )
  79.     (if (= (strlen WantedIndexFile)  0) (set WantedIndexFile  (tackon AminetPath "WANTED"))    )
  80.     (if (= (strlen HiddenFile)       0) (set HiddenFile       (tackon AminetPath "HIDDEN"))    )
  81.     (if (= (strlen IndexedFile)      0) (set IndexedFile      (tackon AminetPath "INDEXED"))   )
  82.     (if (= (strlen RemapFile)        0) (set RemapFile        (tackon AminetPath "MAP"))       )
  83.  
  84.     (complete 15)
  85.     (set KickedPath (askdir
  86.         (prompt
  87.             "Please select your kick off Aminet path"
  88.         )
  89.         (help (cat
  90.             "When examining your local index MirrorManager might find "
  91.             "files which do not exist (anymore) in the Aminet index file.  "
  92.             "These files can be moved (kicked) into the Aminet kick off path."
  93.             "\n\n"
  94.             ("For example:  \"%s\"" (tackon AminetPath "kicked"))
  95.                 ))
  96.         (default KickedPath)
  97.     ))
  98.  
  99.     ;;
  100.  
  101.     (complete 20)
  102.     (set AminetIndexFile (askfile
  103.         (prompt
  104.             "Please select your Aminet INDEX file"
  105.         )
  106.         (help (cat
  107.             "The Aminet INDEX file can be obtained (downloaded) from Aminet.  "
  108.             "It is a list containing almost any file in Aminet.  "
  109.             "MirrorManager needs this file.  "
  110.             "\n\n"
  111.             ("For example:  \"%s\"" (tackon AminetPath "INDEX"))
  112.                 ))
  113.         (default AminetIndexFile)
  114.     ))
  115.  
  116.     ;;
  117.  
  118.     (complete 25)
  119.     (set AminetRecentFile (askfile
  120.         (prompt
  121.             "Please select your Aminet RECENT file"
  122.         )
  123.         (help (cat
  124.             "The Aminet RECENT file can be obtained (downloaded) from Aminet.  "
  125.             "It is a list containing the new files in Aminet.  "
  126.             "\n\n"
  127.             ("For example:  \"%s\"" (tackon AminetPath "RECENT"))
  128.                 ))
  129.         (default AminetRecentFile)
  130.     ))
  131.  
  132.     ;;
  133.  
  134.     (complete 30)
  135.     (set AminetTreeFile (askfile
  136.         (prompt
  137.             "Please select your Aminet TREE file"
  138.         )
  139.         (help (cat
  140.             "The Aminet TREE file can be used to create or update the Aminet directory hierarchy.  "
  141.             "You do not need to maintain a complete Aminet tree, because CleanupIncoming will create "
  142.             "all needed directories automatically.  "
  143.             "Using the TREE file however adds filenotes to all directories.  "
  144.             "\n\n"
  145.             ("For example:  \"%s\"" (tackon AminetPath "TREE"))
  146.                 ))
  147.         (default AminetTreeFile)
  148.     ))
  149.  
  150.     ;;
  151.  
  152.     (complete 35)
  153.     (set FastIndexPath (askdir
  154.         (prompt
  155.  
  156.             "Please select your fast index path"
  157.         )
  158.         (help (cat
  159.             "MirrorManager can split your Aminet INDEX file and create several small index files.  "
  160.             "Looking up a file in these small index files is much faster than using INDEX.  "
  161.             "We now need to know where you want MirrorManager to look for these files."
  162.             "\n\n"
  163.             ("For example:  \"%s\"" (tackon AminetPath "fastindex"))
  164.                 ))
  165.         (default FastIndexPath)
  166.     ))
  167.  
  168.     ;;
  169.  
  170.     (complete 40)
  171.     (set LocalIndexFile (askfile
  172.         (prompt
  173.             "Please select your LOCAL index file"
  174.         )
  175.         (help (cat
  176.             "The LOCAL index file is -- like the Aminet INDEX file -- a list containing "
  177.             "all files in your local Aminet mirror.  "
  178.             "MirrorManager will create such a local index file for you.  "
  179.             "We only need to know a name for it."
  180.             "\n\n"
  181.             ("For example:  \"%s\"" (tackon AminetPath "LOCAL"))
  182.                 ))
  183.         (default LocalIndexFile)
  184.     ))
  185.  
  186.     ;;
  187.  
  188.     (complete 45)
  189.     (set WantedIndexFile (askfile
  190.         (prompt
  191.             "Please select your WANTED index file"
  192.         )
  193.         (help (cat
  194.             "The WANTED file can be used to for auto-downloads from Aminet.  "
  195.             "The supplied Term and NComm scripts allow downloading of files "
  196.             "listed in the WANTED index file.  "
  197.             "MirrorManager can then use this WANTED file to clean up your "
  198.             "incoming directory and add filenotes."
  199.             "\n\n"
  200.             ("For example:  \"%s\"" (tackon AminetPath "WANTED"))
  201.                 ))
  202.         (default WantedIndexFile)
  203.     ))
  204.  
  205.     ;;
  206.  
  207.     (complete 50)
  208.     (set HiddenFile (askfile
  209.         (prompt
  210.             "Please select the list of files to hide in LOCAL"
  211.         )
  212.         (help (cat
  213.             "The HIDDEN file lists all files and directories "
  214.             "which should NOT appear in your LOCAL Aminet index file.  "
  215.             "E.g. if you put this HIDDEN file into your Aminet directory, "
  216.             "then your LOCAL index file would normally contain this file.  "
  217.             "However this might be not what you want.  "
  218.             "You can hide files or directories by adding them to this HIDDEN file."
  219.             "\n\n"
  220.             ("For example:  \"%s\"" (tackon AminetPath "HIDDEN"))
  221.                 ))
  222.         (default HiddenFile)
  223.     ))
  224.  
  225.     ;;
  226.  
  227.     (complete 55)
  228.     (set IndexedFile (askfile
  229.         (prompt
  230.             "Please select the list of files to include in LOCAL"
  231.         )
  232.         (help (cat
  233.             "If you want to list only some of the directories in the Aminet tree "
  234.                         "then you can list them in the INDEXED file.  "
  235.                         "Only the files or directories listed in the INDEXED file will appear "
  236.                         "in your LOCAL index file.  "
  237.                         "This method can be used as an alternative to using the HIDDEN file."
  238.             "\n\n"
  239.             ("For example:  \"%s\"" (tackon AminetPath "INDEXED"))
  240.                 ))
  241.         (default IndexedFile)
  242.     ))
  243.  
  244.     ;;
  245.  
  246.     (complete 60)
  247.     (set RemapFile (askfile
  248.         (prompt
  249.             "Please select your remap file"
  250.         )
  251.         (help (cat
  252.             "If you want CleanupIncoming to copy all files in the Aminet directory A "
  253.             "to a different directory B then you can create a REMAP file which contains "
  254.             "the list of Aminet directories which are to be relocated.  "
  255.             "In the above case it would contain a line:"
  256.             "\n\n              A   B\n\n"
  257.             ("which indicates that the files in your %s directory " IncomingPath)
  258.             "shall be copied to B instead of A."
  259.             "\n\n"
  260.             ("For example:  \"%s\"" (tackon AminetPath "MAP"))
  261.                 ))
  262.         (default RemapFile)
  263.     ))
  264.  
  265.     ;;
  266.  
  267.     (complete 65)
  268.     (textfile
  269.         (prompt ("Generating %s" AssignmentsFile))
  270.         (help @textfile-help)
  271.         (dest AssignmentsFile)
  272.         (append (cat "\n"
  273.             ("IncomingPath     = \"%s\"\n" IncomingPath)
  274.             ("AminetPath       = \"%s\"\n" AminetPath)
  275.             ("KickedPath       = \"%s\"\n" KickedPath)
  276.             ("FastIndexPath    = \"%s\"\n" FastIndexPath)
  277.  
  278.             ("AminetIndexFile  = \"%s\"\n" AminetIndexFile)
  279.             ("AminetRecentFile = \"%s\"\n" AminetRecentFile)
  280.             ("AminetTreeFile   = \"%s\"\n" AminetTreeFile)
  281.             ("LocalIndexFile   = \"%s\"\n" LocalIndexFile)
  282.             ("WantedIndexFile  = \"%s\"\n" WantedIndexFile)
  283.  
  284.             ("HiddenFile       = \"%s\"\n" HiddenFile)
  285.             ("IndexedFile      = \"%s\"\n" IndexedFile)
  286.             ("RemapFile        = \"%s\"\n" RemapFile)
  287.         ))
  288.     )
  289.  
  290.     (complete 80)
  291.     (working ("Configuring %s... Please wait..." configureScript))
  292.  
  293.     (if (run ("%s > ENV:installer-result %s SCRIPT \"%s\" WITH \"%s\"" RX-command ConfigureREXX configureScript AssignmentsFile))
  294.         (abort ("%s\n" (getenv "installer-result")))
  295.     )
  296.  
  297.     (complete 90)
  298.     (working "Generating installer code...")
  299.  
  300.     (if (run ("%s > %s %s READ SCRIPT \"%s\"" RX-command AssignmentsFile ConfigureREXX configureScript))
  301.         (abort ("%s\n" (getenv "installer-result")))
  302.     )
  303.  
  304.     (complete 95)
  305.         (working ("Configuring myself ..."))
  306.  
  307.     (if (run ("%s > ENV:installer-result %s SCRIPT \"%s\" WITH \"%s\" DELIMITER \";@\" TERMINATOR \";end\"" RX-command ConfigureREXX @icon AssignmentsFile))
  308.         (abort ("%s\n" (getenv "installer-result")))
  309.     )
  310.  
  311.     (complete 99)
  312.     (delete AssignmentsFile (prompt "Deleting temporary file..."))
  313.     (delete "ENV:installer-result" (prompt "Deleting temporary file..."))
  314. )
  315.  
  316. ;;
  317.  
  318. (set @default-dest (expandpath @execute-dir))
  319.  
  320. (if (NOT (AND
  321.     (exists ConfigureREXX)
  322.     (exists @app-name)))
  323.  
  324.     (abort (cat
  325.         ("This script needs %s and %s in it's directory.  " ConfigureREXX @app-name)
  326.         "At least one of them is not available."
  327.     ))
  328. )
  329.  
  330. (message (cat
  331.     ("We will now ask you for all currently supported path and filenames in order to configure %s.\n" @app-name)
  332.     "If you're not sure about what all these path and filenames stand for then try clicking Help.  "
  333.     "If this doesn't help then you should have a look at the supplied docs.\n"
  334.     ("Please note that this operation will fail if you overwrote %s by saving it from within the GUI." @app-name)
  335. ))
  336.  
  337. (transcript "Configuring MirrorManager ...")
  338. (set configureScript @app-name)
  339. (configureMirrorManager)
  340.  
  341. (if (exists ProgramIcon)
  342.     (tooltype
  343.         (prompt ("Setting the MirrorManager default configuration to %s..." @app-name))
  344.         (help (cat
  345.             "We are about to set the CONFIG tooltype of the MirrorManager application to\n\n"
  346.             ("CONFIG=%s\n\n" @app-name)
  347.             "This will force MirrorManager to come up with your default configuration "
  348.             "each time you double-click the promgram icon."
  349.         ))
  350.         (dest ProgramIcon)
  351.         (settooltype "CONFIGNAME" ("rexx/%s" @app-name))
  352.         (confirm)
  353.     )
  354. )
  355.  
  356. (complete 100)
  357.  
  358. (exit (cat
  359.     "The MirrorManager default configuration has been modified.  "
  360.     ("Note that you must never overwrite %s by saving it from within the GUI.  " @app-name)
  361.     ("Instead you should edit %s with an ASCII Editor like e.g. MEmacs.  " @app-name)
  362. ))
  363.  
  364. ;end
  365.